#include "pushbutton.h"
#include <time.h>
#include <stdlib.h>
#include <QDebug>


PushButton::PushButton(QWidget* parent):QPushButton(parent)
{
    srand((unsigned int)time(0));
}

void PushButton::enterEvent(QEvent *event)
{
    (void) event;
    qDebug()<<"enter";

    QWidget* widget=new QWidget();

    int width=widget->geometry().width();
    int height=widget->geometry().height();

    int x=rand()% width;
    int y=rand()% height;

    this->move(x,y);
}

void PushButton::leaveEvent(QEvent *event)
{
    // (void) event;
    // qDebug()<<"leave";

    // int width=this->geometry().width();
    // int height=this->geometry().height();

    // int x=rand()% width;
    // int y=rand()% height;

    // this->move(x,y);
}


